package com.zc.study.designPattern.创建型设计模式.prototypePattern.shallowClone;

/**
 * 工作周报weeklyLog
 */
public class WeeklyLog implements Cloneable {
    //为了简化设计和实现,假设一份工作周报中只有一个附件对象,实际情况中可以包含多个附件
    //可以通过List等集合对象来实现
    private Attachment attachment;
    private String name;
    private String date;
    private String content;

    //使用clone方法实现浅clone
    public WeeklyLog clone(){
        Object obj = null;
        try {
            obj =super.clone();
            return (WeeklyLog)obj;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }



    public Attachment getAttachment() {
        return attachment;
    }

    public void setAttachment(Attachment attachment) {
        this.attachment = attachment;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
